import pymssql
import redis
import threading

# database
conn = pymssql.connect(host='sinongassignment.database.windows.net' ,user='sinong' ,password = 'wang1997h,./',database='Scrum')
cur = conn.cursor()
if not cur:
    raise(NameError,'connect database Scrum failed')
else:
    print("connect database Scrum succeed.")

# redis
r = redis.StrictRedis(host='sinong.redis.cache.windows.net',port=6380, db=0, password='Pc2Z0uRPmtk5SDK687Mvpml2pHaqVW7gLAzCaI1RFD8=',ssl=True)
# r = redis.StrictRedis(host='sinong.redis.cache.windows.net',port=6380, db=0, password='Pc2Z0uRPmtk5SDK687Mvpml2pHaqVW7gLAzCaI1RFD8=',ssl=False)
# result = r.ping()
# print("redis ping returned : " + str(result))

# database lock
mutex = threading.Lock()

